perm filename PAPMAC.OLD[1,3]1 blob sn#546425 filedate 1980-12-01 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00006 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	% CHAPTERS, SECTIONS, HEADLINES.       READ MAXTEX for documentation.
C00011 00003	% FOOTNOTES, NOTES, COMMENTS, FIGURES, TABLES, BIBLIOGRAPHY
C00016 00004	% TABLE OF CONTENTS & PLATES
C00019 00005	% PAGE STYLES
C00023 00006	% INITIALIZATIONS
C00025 ENDMK
C⊗;
% CHAPTERS, SECTIONS, HEADLINES.       READ MAXTEX for documentation.

	% Headline routine; produces titlepage depending on \ddvnum setting
	%   (F or T: remember \oneside, \bothsides) and parity of page.  It will
        %   \endpage, set a big headline and declare \titlepage:
\def\ddvnheadline#1{\titlepage\null\vskip\hdltopskip
		    {\Tit\ddvnjust{#1}}\vskip\hdlbtmskip\penalty 1022}
	% This one centers a big headline:
\def\ctrheadline#1{\titlepage\null\vskip\hdltopskip
		    {\Tit\ctrline{\ctrcol{#1}}}\vskip\hdlbtmskip\penalty 1022}



	% Start a chapter; #1 = title
\def\chapterbegin#1{\chapterbeginb{#1}{#1}}
	% Start an un-numbered "chapter" (like "Appendix A", or "Bibliography");
	%   #1 = title
\def\appchapterbegin#1{\appchapterbeginb{#1}{#1}}

	% Start a section; title = #1
\def\sectionbegin#1{\sectionbeginb{#1}{#1}}
	% Start un-numbered section, usually at end of chapter ("Notes",
	%   "Problems", "Appendix A: <some title>", etc.), or at begining 
	%   (e. g., "Introduction"):
\def\appsectionbegin#1{\appsectionbeginb{#1}{#1}}

	% Start sub-section; title = #1:
\def\subsectionbegin#1{\subsectionbeginb{#1}{#1}}
	% Start un-numbered subsection; title = #1
\def\appsubsectionbegin#1{\appsubsectionbeginb{#1}{#1}}

	% Similar to the above, but #1 = title, #2 = abbreviation:
\def\chapterbeginb#1#2{\¬
	\chapterdeclare{\headline{{\chapfmt}\cr\noalign{\vskip\chapmidskip} #1}
		      }{\Chapter\hquad\chapnumcase{\chapnum}\hquad #2\¬
		      }{\chapnumcase{\chapnum}. #2}
	\advnce8
	\ifpos8{\gdef\consnum##1{\chapnum.##1}
	 }\else{\gdef\consnum##1{\chapnumcase{\chapnum}.##1}} }
\def\appchapterbeginb#1#2{\chapterdeclare{\headline{#1}}{#2}{#2}
			  \setcount8 0
			  \gdef\consnum##1{##1}}
\def\sectionbeginb#1#2{\addq1{\varsec}
	\sectiondeclare{\hangindent\indsect\raise 1.5pt
			\hbox{$\section$}\tit\sectionnum\hquad #1\¬
		      }{\sectionnum\hquad #2
		      }{\sectionnum\hquad #2} }
\def\appsectionbeginb#1#2{\sectiondeclare{\tit #1}{#2}{#2} }
\def\subsectionbeginb#1#2{\addq1{\varssec}
	\subsectiondeclare{\hangindent\indssect\tenpoint\bf\subsecnum\hquad\rm #1
			 }{\subsecnum. #2}}
\def\appsubsectionbeginb#1#2{\subsectiondeclare{\hangindent\indssect\tenpoint #1
			   }{#2}}




	% To interchange running heads. Useful for chapters that don't use
	%   sections in \bottomnumbering style. Type it immediately after
	%   declaring the chapter:
\def\rhswap{\xdef\junkie{\rhevenpg}\xdef\rhevenpg{\rhoddpg}
	    \xdef\rhoddpg{\junkie}\titlemark{\rhevenpg}{\rhoddpg}}

	% Handle sections as chapters, and subsections as sections (READ MAXTEX):
\def\secsubsecstyle{\setcount8 0
	\let\junkiesecdec=\sectiondeclare
	\def\sectiondeclare##1##2##3{\junkiesecdec{##1}{##2}{##3}
		{\rhtypeface\xdef\rhevenpg{##3}}
		\titlemark{\rhevenpg}{\rhoddpg}}
	\let\junkiesubsec=\subsectiondeclare
	\def\subsectiondeclare##1##2{\junkiesubsec{##1}{##2}
		{\rhtypeface\xdef\rhevenpg{##2}}
		\titlemark{\rhevenpg}{\rhoddpg}}
	\let\titlemark=\titlemarkinv}

	% Set headings once and for all; #1=even pages, #2=odd
\def\fixedheadings#1#2{{\rhtypeface\titlemark{#1}{#2}}\let\titlemark=\titlemarknh}


% THE following are for internal use; use at own risk.  These define the formats
%   used in headlines, headings, etc.
	% For chapter and appchapter titlepages:
\def\Tit{\:A}
	% For section and appsection headlines:
\def\tit{\:B}

\def\ddvnjust#1{\ddvnmsel{\lftcol{#1}}{\rjustline{\rtcol{#1}}}}

	% First line in chap. headline format; see \chapterbeginb
\def\ddvnchapfmt{\teniu\Chapter\hquad\chapnumcase{\chapnum}}
\def\ctrchapfmt{\:L\chapnumcase{\chapnum}}
	% When using roman numerals (\count8 negative), you may set this to be
	%   {\uppercase{#1}}.
\def\chapnumcase#1{#1}
	% #1 = headline format, #2 = tofc format, #3 = even rh format
	%   See \chapterbegin and \appchapterbegin invocations.
\def\chapterdeclare#1#2#3{\chapskippage
		\setq{\chapnum}{\count8}
		\setq{\varsec}0
		\setq{\varssec}0
		\setq{\varstmt}0
		\setq{\varfn}0
		#1\constofc1{#2}
		{\rhtypeface\xdef\rhevenpg{#3}
		 \xdef\rhoddpg{#3}}
		\titlemark{\rhevenpg}{\rhoddpg} }
	% Skip to next odd page (if \bothsides)
\def\chapskippage{\endpage}
	% To enable, do:
%def\chapskippage{\endpage\ddvnmsel{\hquad\endpage}{}}

	% #1 = headline format, #2 = tofc format, #3 = odd rh format
	%  See \sectionbegin and \appsectionbegin invocations: self-explanatory.
\def\sectiondeclare#1#2#3{\¬
        \xdef\sectionnum{\consnum{\varsec}}
	\setq{\varssec}0
	\sectionskip
	\hbox par size{\ragged 1000 #1\constofc2{#2}}
	{\rhtypeface\xdef\rhoddpg{#3}}
	\titlemark{\rhevenpg}{\rhoddpg}
	\posthdrskip}

	% #1 = headline format, #2 = tofc format; see  \subsectionbegin invocation.
\def\subsectiondeclare#1#2{\¬
	\xdef\subsecnum{\consnum{\varsec.\varssec}}
	\sectionskip
	\hbox par size{\ragged 1000 #1\constofc3{#2}}
	\posthdrskip}

	% Spacing before and after headings:
\def\hdltopskip{.35vu}
\def\hdlbtmskip{2.5vu plus 2pt}
\def\chapmidskip{10pt}
\def\posthdrskip{\penalty 1011\vskip 5pt\penalty 1011}
\def\sectionskip{\penalty-231\vskip 24pt plus 12pt minus 6pt\penalty -234}

	% Indentation & boxes sizes:
\def\indsect{.4375vu}	% (not to be confounded with a bug)
\def\indssect{.4375vu}
% FOOTNOTES, NOTES, COMMENTS, FIGURES, TABLES, BIBLIOGRAPHY


	% Set footnote; number automatically for each chapter:
\def\nfootnote#1{\addq1{\varfn}\setfootnote{\varfn}{#1}{\null\vskip \footntskip}}

	% Insert fn; identify them yourself (#1 = *, for example)
\def\footnote#1#2{\setfootnote{#1}{#2}{\null\vskip \footntskip}}

	% Similar to the above; but these set a bar on top of f.n.:
\def\bnfootnote#1{\addq1{\varfn}\setfootnote{\varfn}{#1}{\footnotebar}}
\def\bfootnote#1#2{\setfootnote{#1}{#2}{\footnotebar}}
	% Use instead of "." for less space (see DOC):
\def\.{\hbox{.}\penalty 100000\hskip0pt\penalty100000}

	% Various parameters you may redefine
\def\footntskip{3.5pt plus 1pt}
\def\footntsize{size}

	% \anotate keeps track of notes (and of the page where they occur),
	%    which will be output when \listnotes is used. This should be at the
	%    end of a chapter:
\def\anotate#1{\save6\vbox{\box6\yskip
			   \hbox par size{\lntypeface\lnfmt #1}}}
\def\chaplistnotes{\appchapterbegin{\Notes}{\lntypeface\unbox6}}
\def\seclistnotes{\appsectionbegin{\Notes}{\lntypeface\unbox6}}
\def\lnfmt{\hangindent 10pt\Page\hquad\count0.\hquad}
\def\lntypeface{\ninepoint}


	% \comment allows commentaries in your manuscript that can be printed
	%    selectively;  e.g.  <some text> \comment{\jls}{I think...} <more
	%    text>.  Comment will appear iff \jls is defined differently than
	%    \def\jls{} (jls are supposed to be the commentator's initials).
\def\comment#1#2{\ifnull#1\then{}\else{[{\bf #1: }#2]\hquad}}


	% A simple macro to format references (see also \enumerate):
\def\ref#1{\yskip
	   \xdef\junkie{\reffmt{#1}}
	   \save8\hbox{\junkie}
	   \noindent\hangindent 1wd8
	   \hmode\junkie\hskip 0pt}
\let\refind=\itemzind
\def\reffmt#1{\hbox to \refsize{\lft{[#1]}}}
\def\refsize{35pt}


	% Macros to leave space for figures or tables;  #1 = vertical dimension
	%   #2 = <title of figure>. See DOC for esoteric usage.
\def\figure#1#2{\figtab{#1}{#2}{\varfig}{\Figure}{\varfig}}
\def\table#1#2{\figtab{#1}{#2}{\vartab}{\Table}{\vartab}}
	% Same, but let TEX look for a convenient place to insert:
\def\figuref#1#2{\topinsert{\figure{#1}{#2}}}
\def\tablef#1#2{\topinsert{\figtab{#1}{#2}}}
	% Now these set desired format for caption:
\def\ftctr#1#2#3{\ctrline{\ctrcol{\it #1\hquad #2. \rm #3}}}
\def\ftatop#1#2#3{\ctrline{\it #1\hquad #2}\vskip 5pt\ctrcol{#3}}
\def\ftatoppar#1#2#3{\ctrline{\it #1\hquad #2}\vskip 5pt\displaypar{#3}}
	% Default format:
\let\ftfmt=\ftctr

% FOR internal use:
\def\setfootnote#1#2#3{\unskip\unskip\unskip\penalty 100000
	{\eightpoint
	 \save7\hbox{#1}
	 \botinsert{#3\hbox par \footntsize{\hangindent1wd7\raise 4pt\hbox{#1}#2}}
	 \unskip\penalty 100000\hskip -2.8pt\penalty 100000
	 \raise 3.5pt\box7\penalty -150}}
\def\footnotebar{\null\vskip \footntskip\hrule width 1.5vu\vskip 3pt}
\def\figtab#1#2#3#4#5{\addq1{#3}\null\vskip #1\penalty 100000
			\vskip 3pt plus 3pt\penalty 100000
			\constofp{#4\hquad #5. #2}
			\ftfmt{#4}{#5}{#2}}
% TABLE OF CONTENTS & PLATES

	% Table of contents (chapters, sections, etc.):
\def\tableofcontents#1{\dotableofcontents{#1}{\Contents}{9}{tofc}}

	% Table of figures and tables:
\def\tableofplates#1{\dotableofcontents{#1}{\Plates}{8}{tofp}}

	% Add entry to table of contents: #1 (=1,2,3) is level of indentation,
	%   #2 = title as it is to appear on t. of c., #3 = page NUM plus 1
\def\addtotofc#1#2#3{{\tofctypeface\send9{|tofcline{#1}{#2}{#3}}}}

	% Add entry to table of figures and tables; #1 = one line caption, #2 = NUM
	%   as above
\def\addtotofp#1#2{{\tofctypeface\send8{|tofpline{#1}{#2}}}}

	% Font used for t. of c., p.
\let\tofctypeface=\ninepoint


% THE following are for internal use only; use at own risk:
	% Generate table of contents:
\def\dotableofcontents#1#2#3#4{\endpage\romannumbering{#1}
	\headline{#2}
	\if T\ddvnum{\gdef\rhevenpg{#2}}
               \else{\gdef\rhevenpg{}}
	\gdef\rhoddpg{#2}
	\titlemark{\rhevenpg}{\rhoddpg}
	{\tofctypeface
	 \rjustline{\Page}
	 \chcode '174←0	% | enabled as escape char.
	 \open #3=jk#4.tmp
	 \def\cr{}
	 \input #4.tmp
	 \endpage}}
	% The t.c. output routine;
\def\tofcline#1#2#3{
	\if1#1{\vskip 15pt plus 8pt minus 4pt\penalty -50
		\tofcbox{0vu}{#2}{#3}\vskip 4pt plus 2pt\penalty 250}
	\else{\if2#1{\tofcbox{.25vu}{#2}{#3}\penalty 125}
	      \else{\tofcbox{.5vu}{#2}{#3}\penalty 50}} }
\def\tofcbox#1#2#3{
	\hbox to size{\hbox to #1{}#2\leadtc \setcount9#3\advcount9 by-1
		      \hbox to 1.5em{\hfill\count9} }}
	% The t.p. output routine
\def\tofpline#1#2{\tofcbox{0pt}{#1}{#2}}
	% Cons t. of c.
\def\constofc#1#2{\addtotofc{#1}{#2}{\count0}}
\def\constofp#1{\addtotofp{#1}{\count0}}
	% Leaders (. . .); see manual
\def\leadtc{\leaders\hbox to 8pt{\hfill.\hfill}\hfill}
	%Initialize files:
\open 9=tofc.tmp
\open 8=tofp.tmp
% PAGE STYLES

	% Page handling
\def\titlepage{\gdef\tpage{T}}	 % page with no heading
\def\normalpage{\gdef\tpage{F}}	 % heading ok

	% Select page style; five flavours. Described by READ MAXTEX (try them)
\def\bottomnu`αering{\endpage
	\oneside
	\vsize 8vu		%\epagesize-.75vu
	\gdef\thepage{\botmark\vfill\page\cbotnum}
	\gdef\titpage{\null\vfill\page\cbotnum}
	\let \titlemark=\titlemarkbtm}

\def\onelineheading{\endpage
	\bothsides
	\vsize 8.25vu		%\epagesize-.5vu
	\gdef\thepage{\botmark\vfill\page}
	\gdef\titpage{\null\vfill\page\numonlyrmn}
	\let \titlemark=\titlemarknln}

\def\oddevennumbering{\onelineheading\let\nlnhdng=\ddvnhdng}

\def\topboxes{\endpage
	\bothsides
	\vsize 8.125vu		%\epagesize-.625vu
	\gdef\thepage{\botmark\vfill\page}
	\gdef\titpage{\null\vfill\page\numonlyrmn}
	\gdef\trule{\vrule height 12.5 pt depth 6.5pt}
	\let \titlemark=\titlemarkcrn}

% THE following are for internal handling of pages; use at own risk:

	% Set bottom number iff roman:
\def\numonlyrmn{\ifpos0{\vskip\btmnrspace\null}\else{\cbotnum}}
	% Fonts (8pt) used for running-heads:
\let\rhtypeface=\eightpoint
\def\hdrfnt{\caps}
	% Font (8pt italic) used for TOP page numbers (cf \botfnt)
\def\topnum{\it}
	% Mark routines:

\def\titlemarkbtm#1#2{{\rhtypeface\mark{\onelinh{\hdrfnt{#1}\hfill #2}}}\¬}
\def\onelinh#1{\vbox{\hbox to size{#1}\vskip 3pt\hrule height .2pt}}

\def\titlemarknln#1#2{{\rhtypeface\mark{\onelinh{\nlnhdng{#1}{#2}}}}\¬}
\def\titlemarkinv#1#2{\titlemarknln{#2}{#1}}

\def\ddvnhdng#1#2{\ifeven0{{\topnum\count0}\hfill {\hdrfnt #1}}
		     \else{{\hdrfnt #2}\hfill{\topnum\count0}} }

\def\titlemarkcrn#1#2{{\rhtypeface\mark{\boxh{\¬
	\ifeven0{\hbox to 25pt{\ctr{\topnum\count0}}\trule\ctr{\hdrfnt #1}}
	   \else{\ctr{\hdrfnt #2}\trule\hbox to 25pt{\ctr{\topnum\count0}}}  }}}\¬}
\def\boxh#1{\vbox{\hrule\hbox to size{\trule #1\trule}\hrule}}
% INITIALIZATIONS

	% Global variables:
\def\chapnum{0}
\def\sectionnum{}
\def\subsecnum{}
\def\rhevenpg{}
\def\rhoddpg{}

\oddevennumbering		% see also \bottomnumbering, \noheading, \topboxes,
				%  \onelineheading, \oddevennumbering,
				%  \fixedheadings, \secsubsecstyle, \fullpages

\let\headline=\ddvnheadline	% see also \ctrheadline
\let\chapfmt=\ddvnchapfmt	% see also \ctrchapfmt

\setcount8 0			% no chapter declared
\setq{\varsec}0			% start at section 1
\setq{\varssec}0		% start at subsection 1

\inivar{\varfn}1		% start at footnote 1
\inivar{\varfig}1		% start at figure 1
\inivar{\vartab}1		% start at table 1

\normalpage			% see also \titlepage